{% autoescape off %}
<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <title>{{source_info}}和其他{{out_title}}间关联关系</title>
	<link href="/static/css/bootstrap.min.css" rel="stylesheet" /> 
	<script src="/static/js/jquery.min.js"></script> 
	<script src="/static/js/bootstrap.min.js"></script>   
	
	<link rel="stylesheet" type="text/css" href="/static/Blueprint_ Slide and Push Menus_files/default.css">
	<link rel="stylesheet" type="text/css" href="/static/Blueprint_ Slide and Push Menus_files/component.css">
	<script type="text/javascript" async="" src="/static/Blueprint_ Slide and Push Menus_files/ga.js"></script>
	<script src="/static/Blueprint_ Slide and Push Menus_files/modernizr.custom.js"></script>
	    
</head>
<body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div style = "margin: 0; font-size: 9px; text-align: right; color: #487858;">
    
    <a href="/version_net_detail_csv_{{source_download_info}}/">Download</a>
    </div>
    <div style = "margin: 0; font-size: 5px; text-align: center;">
	<button id="showRight"; class="btn btn-link"><span class="ui-icon ui-icon-arrowthick-2-e-w"></span></button>
	
    </div>
    
    <nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-right" id="cbp-spmenu-s2">
		
		
			<table class="table">
			   <thead>
			      <tr>
			         <th>系统名称</th>
			         <th>版本号</th>
			         <th>UAT上线时间</th>
			         <th>模拟上线时间</th>
			      </tr>
			   </thead>
			   <tbody>
					{{out_str}}
			   </tbody>
			</table>
	 
		</nav>

 <div id="main" style="height:600px">
		
		
		
	</div> 

	<link rel="stylesheet" href="{{ STATIC_URL }}css/jquery-ui.min.css">
	<script src="{{ STATIC_URL }}js/jquery.min.js"></script>
	<script src="{{ STATIC_URL }}js/jquery-ui.min.js"></script>
	<link rel="stylesheet" href="{{ STATIC_URL }}css/style.css">
    <!-- ECharts单文件引入 -->
    <script src="{{ STATIC_URL }}js/echarts.js"></script>
	<div id="dialog" title="{{out_title}}间网状交互">
	<p></p>
	</div>


    <script type="text/javascript">
        // 路径配置
		$(function() {
			$( "#dialog" ).dialog({
			  autoOpen: false,
			  show: {
				effect: "blind",
				duration: 1000
			  },
			  hide: {
				effect: "explode",
				duration: 1000
			  }
			 
			});
		  });
		
        require.config({
            paths: {
                echarts: '{{ STATIC_URL }}js/build/dist'
            }
        });
        
        // 使用
        require(
            [
                'echarts',
                'echarts/chart/force' // 使用力导向布局图就加载force模块，按需加载
            ],
            function (ec) {
                // 基于准备好的dom，初始化echarts图表
                var myChart = ec.init(document.getElementById('main')); 
		
        
        var option = {
    title : {
        text: '{{source_info}}和其他系统及版本间关联关系',
        subtext: '网状关系版',
        x:'right',
        y:'bottom'
    },
    
    toolbox: {
        show : true,
        feature : {
            restore : {show: true},
            saveAsImage : {show: true}
        }
    },
    legend: {
        x: 'left',
        data:['主升级系统','同步升级系统','联测系统','其它','传输依赖']
    },
    series : [
        {
            type:'force',
            name : "版本关联关系",
            ribbonType: false,
            categories : [
                {
                    name: '主升级系统',
					 itemStyle: {
                        normal: {
                            color : '#ffff00'
                        }
                    }
					
                },
				
                {
                    name: '同步升级系统',
					itemStyle: {
                        normal: {
                            color : '#ff0000'
                        }
                    }
					
                },
				 {
                    name: '联测系统',
					itemStyle: {
                        normal: {
                            color : '#ffaeb9'
                        }
                    }
                },
				 {
                    name: '其它',
					itemStyle: {
                        normal: {
                            color : '#6495ed'
                        }
                    }
                },
				{
                    name: '传输依赖',
					itemStyle: {
                        normal: {
                            color : '#87CEFF'
                        }
                    }
                },                
            ],
            itemStyle: {
                normal: {
                    label: {
                        show: true,
                        textStyle: {
                            color: '#333'
                        }
                    },
                    nodeStyle : {
                        brushType : 'both',
                        borderColor : 'rgba(255,215,0,0.4)',
                        borderWidth : 1
                    },
                    linkStyle: {
                        type: 'line'
                    }
                },
                emphasis: {
                    label: {
                        show: false
                        // textStyle: null      // 默认使用全局文本样式，详见TEXTSTYLE
                    },
                    nodeStyle : {
                        //r: 30
                    },
                    linkStyle : {}
                }
            },
            useWorker: false,
            minRadius : 15,
            maxRadius : 40,
            linkSymbol: 'arrow',
            gravity: 1.1,
            scaling: 1.2,
            roam: 'move',
            
            nodes:[
                {category:0, name: '{{source_info}}', value : 45,
                    itemStyle: {
                        normal: {
                            label: {
                                textStyle: {
                                    color: 'black',
                                    fontSize: 10
                                  
                                }
                            }
                        }
                    }
                },
	           	{% for target in target_need_sync %}
	            	{category:1, name: '{{ target }}', value : 25,
	            	    itemStyle: {
                        normal: {
                            label: {
                                textStyle: {
                                    color: 'black',
                                    fontSize: 10
                                  
                                }
                            }
                        }
                    }
	            	},
	            {% endfor %}              
	            {% for target in target_need_test %}
	            	{category:2, name: '{{ target }}', value : 20,
	            	    itemStyle: {
                        normal: {
                            label: {
                                textStyle: {
                                    color: 'black',
                                    fontSize: 10
                                  
                                }
                            }
                        }
                    }
	            	},
	            {% endfor %}     
	            {% for target in target_others %}
	            	{category:3, name: '{{ target }}', value : 15,
	            	    itemStyle: {
                        normal: {
                            label: {
                                textStyle: {
                                    color: 'black',
                                    fontSize: 10
                                  
                                }
                            }
                        }
                    }
	            	},
	            {% endfor %} 
	            
	            {% for target in comm_node_need_sync %}
	            	{category:1, name: '{{ target }}', value : 3,
	            	    itemStyle: {
                        normal: {
                            label: {
                                textStyle: {
                                    color: 'black',
                                    fontSize: 10
                                  
                                }
                            }
                        }
                    }
	            	},
	            {% endfor %} 
	            {% for target in comm_node_need_test %}
	            	{category:2, name: '{{ target }}', value : 3,
	            	    itemStyle: {
                        normal: {
                            label: {
                                textStyle: {
                                    color: 'black',
                                    fontSize: 10
                                  
                                }
                            }
                        }
                    }
	            	},
	            {% endfor %} 
	            {% for target in comm_node_others %}
	            	{category:4, name: '{{ target }}', value : 3,
	            	    itemStyle: {
                        normal: {
                            label: {
                                textStyle: {
                                    color: 'black',
                                    fontSize: 10
                                  
                                }
                            }
                        }
                    }
	            	},
	            {% endfor %} 	            	            	            
	            {% for target in comm_node_others_true %}
	            	{category:3, name: '{{ target }}', value : 3,
	            	    itemStyle: {
                        normal: {
                            label: {
                                textStyle: {
                                    color: 'black',
                                    fontSize: 10
                                  
                                }
                            }
                        }
                    }
	            	},
	            {% endfor %} 	            
	                          

            ],
            links : [
	            {% for pair in pair_list %}
	            	{{pair}}
	            {% endfor %}
            ]
        }
    ]
};
var ecConfig = require('echarts/config');
var dialog_tabel_info = {
	{% for source_taget,s_t_info in source_target_info.items %}
		'{{source_taget}}':'{{s_t_info}}',
		
	{% endfor %}
}
        // 为echarts对象加载数据 
        myChart.setOption(option); 
		
		

function eConsole(param) {
	var lineName = param.name//辨别当前点中的边
	if (lineName.indexOf(" - ") >= 0 ){
		if(!dialog_tabel_info[lineName]){
			tmp_list =  lineName.split(" - ")
			lineName = tmp_list[1]+" - "+tmp_list[0]
		}
		var s_t_info = dialog_tabel_info[lineName].split("	")
		var lineFrom = s_t_info[5];
		//var lineTarget = param.value.target;
		var lineTarget = s_t_info[6];
		document.getElementById('dialog').innerHTML = "<p>{{conf_node_info}}</p>"+
		"<p>传输依赖备注:"+s_t_info[3]+"</p>"+
		"<p>数据交互备注:"+s_t_info[4]+"</p>"+
		"<table border='1'>"+
		"<tr><th>"+lineFrom+"</th><th>"+lineTarget+"</th></tr>"+
		"<tr><td>本版本新增数据的流向</td><td>"+s_t_info[0]+"</td></tr>"+
		"<tr><td>关联系统是否联测</td><td>"+s_t_info[1]+"</td></tr>"+
		"<tr><td>关联系统是否升级</td><td>"+s_t_info[2]+"</td></tr></table>";
		$( "#dialog" ).dialog( "open" );
	}
	else{
		lineName = lineName.replace("\t","|")
		window.location.href='/version_node_net_'+lineName+'/';
	}
}

		myChart.on(ecConfig.EVENT.CLICK, eConsole);
		myChart.on(ecConfig.EVENT.DBLCLICK, eConsole);
		//myChart.on(ecConfig.EVENT.HOVER, eConsole);
		myChart.on(ecConfig.EVENT.DATA_ZOOM, eConsole);
		myChart.on(ecConfig.EVENT.LEGEND_SELECTED, eConsole);
		myChart.on(ecConfig.EVENT.MAGIC_TYPE_CHANGED, eConsole);
		myChart.on(ecConfig.EVENT.DATA_VIEW_CHANGED, eConsole);

		
		}
		);
		
		
    </script>
    <div style = "margin: 0; font-size: 11px; text-align: right; color: #487858;">
		<a href="/upload_file/">| 文件上传</a> |
		<a href="/system_detail/">系统详情页</a> |
		<a href="/version_detail/">版本详情页</a> |
		<a href="/wiki_index/">系统百科页</a> |
		<a href="/dataex_detail/">交互信息展示页</a> |
		<a href="/cm_baseline/">基线展示页</a> |
		<a href="/cm_bi_index/">报表展示页</a> |
		<a href="/test_report_index/">测试周报页</a> |
	</div>
	
	
	<script src="/static/Blueprint_ Slide and Push Menus_files/classie.js"></script>
		<script>
			var 
				menuRight = document.getElementById( 'cbp-spmenu-s2' ),
				showRight = document.getElementById( 'showRight' ),
				body = document.body;

			
			showRight.onclick = function() {
				classie.toggle( this, 'active' );
				classie.toggle( menuRight, 'cbp-spmenu-open' );
			};
			
			
		</script>
	
	
</body>
{% endautoescape %}